package com.ls.lserp.modules.order.service;



import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ls.lserp.common.persistence.Page;
import com.ls.lserp.common.service.CrudService;
import com.ls.lserp.common.utils.DateUtils;
import com.ls.lserp.common.utils.ResourcesUtil;
import com.ls.lserp.modules.order.dao.AuditInfoDao;
import com.ls.lserp.modules.order.dao.BigcargoOrderDao;
import com.ls.lserp.modules.order.dao.CustomizationMonitorDao;
import com.ls.lserp.modules.order.dao.OrderDao;
import com.ls.lserp.modules.order.entity.AuditInfo;
import com.ls.lserp.modules.order.entity.BigcargoOrder;
import com.ls.lserp.modules.order.entity.CustomizationContract;
import com.ls.lserp.modules.order.entity.DesignOption;
import com.ls.lserp.modules.order.entity.OperatingP;
import com.ls.lserp.modules.order.entity.Order;
import com.ls.lserp.modules.order.entity.Quotation;
import com.ls.lserp.modules.order.entity.SizeColorQuantity;
import com.ls.lserp.modules.order.entity.StyleFit;
import com.ls.lserp.modules.order.entity.StyleOperationtings;
import com.ls.lserp.modules.sys.entity.Sequence;
import com.ls.lserp.modules.sys.utils.SequenceUtil;
import com.ls.lserp.modules.sys.utils.UserUtils;
@Service
@Transactional(readOnly = false)
public class CustomizationMonitorService extends CrudService<OrderDao, Order>{

	//合同
	 @Autowired
	    private CustomizationMonitorDao customizationMonitorDao ;
	// 审核表
	@Autowired
	    private AuditInfoDao  auditInfoDao;

	    /**
		 * 查询父项
		 * @param page
		 * @param user
		 * @return
		 */
	    public Page<CustomizationContract> findCustomizationMonitorList(Page<CustomizationContract> page, CustomizationContract customizationContract) {
	        // 生成数据权限过滤条件（dsf为dataScopeFilter的简写，在xml中使用 ${sqlMap.dsf}调用权限SQL）
	        //designOption.getSqlMap().put("dsf", dataScopeFilter(user.getCurrentUser(), "o", "a"));
	        // 设置分页参数
	    	customizationContract.setPage(page);
	        // 执行分页查询
	        page.setList(customizationMonitorDao.findMonitorList(customizationContract));
	        return page;
	    }
	    
	    /**
	     * 得到设计表信息
	     */
	    public List<DesignOption> getdesignList() {
	        List<DesignOption> designOptionList = customizationMonitorDao.getdesignList();
	        return designOptionList;
	    }
	    
	    /**
	     * @Title: findList
	     * @Description: 查询
	     * @param @param page
	     * @param @param Order
	     * @param @return
	     * @return Page<Order>
	     * @throws
	     */
	    public Page<Order> findList(Page<Order> page, Order order) {
	        // 设置分页参数
	        order.setPage(page);
	        /*List<Order> orders = customizationMonitorDao.findList(order);
	        for (int i = 0; i < orders.size(); i++) {
	        	List<StyleOperationtings> orderList = customizationMonitorDao.findOperatingList(orders.get(i).getOrderNO());
	        	orders.get(i).setOperationtingsList(orderList);
	        }*/
	        // 执行分页查询
	        page.setList(customizationMonitorDao.findList(order));
	        return page;
	    }
	    
	    /**
	     * 得到工序信息
	     */
	    public List<OperatingP> getOperatingPList() {
	        List<OperatingP> operatingP = customizationMonitorDao.getOperatingPList();
	        return operatingP;
	    }
	    
}
